// page/coach/map.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
  
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    that.setData({
      options: options,
    })
  },
  onShow: function () {
    var app = getApp()
    var that = this;
    var uid = wx.getStorageSync('uid');
    var picker_arr = []
    wx.request({
      url: app.globalData.host + '&g=App&m=Worker&a=info',
      data: {
        id: that.data.options.id,
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res.data)
        var ad = res.data.ad;
        var ym = res.data.ym;
        var lat = res.data.ad.lat;
        var lng = res.data.ad.lng;
        // console.log(that.data)
        ym.forEach(function (e) {
          picker_arr.push(e.name);
        })
        that.setData({
          ad: res.data.ad,
          lat: res.data.ad.lat,
          lng: res.data.ad.lng,
          // 地图标记
          markes: [{
            iconPath: "",
            id: 0,
            latitude: lng,
            longitude: lat,
            width: 33,
            height: 42,
            desc:'我的位置'
          }],
        })
      }
    })
  }
})